<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="../../angular-1.5.8/angular.js"></script>
</head>
<body>
    <div ng-app="mainApp" ng-controller="mainController">
        <!--第一种方法-->
        <div>{{333|func}}</div>
        <div>{{num}}</div>
    </div>
</body>
<script>
    angular.module("mainApp",[])
          .controller("mainController",function($scope,$filter){
                $scope.num=$filter("func")(45);
          } )
          .filter("func",function (){
              return function(value){
                  return ('['+value+']')
                  return 
              }
          })
</script>
</html>